package com.leyou.item.mapper;

import com.leyou.common.mapper.BaseMapper;
import com.leyou.item.pojo.Category;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * Created by IntelliJ IDEA.
 *
 * @author: wangzibeng
 * Date: 2019/4/28 0028
 * Time: 13:07
 */

@Repository
public interface CategoryMapper extends BaseMapper<Category> {

    /**
     * 商品分类和品牌的中间表
     * 自定义sql
     * 获取所有的品牌ID
     *
     * @param id
     * @return
     */

    @Select("select category_id from tb_category_brand where brand_id =#{id}")
    int[] getCategoryIds(@Param("id") Long id);
}
